package com.dsg.entity.apply;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dsg.entity.coupon.DsgCouponSend;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 油咭資料
 * </p>
 *
 * @author system
 * @since 2020-07-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("dsg_apply_card")
@ApiModel(value = "DsgApplyCard对象", description = "油咭資料")
public class DsgApplyCard implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主鍵")
    @TableId("OID")
    private String oid;

    @ApiModelProperty(value = "SC返咭類型")
    @TableField(exist = false)
    private String type;

    @ApiModelProperty(value = "原油咭ID")
    @TableField("OLD_CARD_ID")
    private String oldCardId;

    @ApiModelProperty(value = "折扣")
    @TableField(exist = false)
    private List<DsgApplyDiscount> discountList;

    @ApiModelProperty(value = "油券")
    @TableField(exist = false)
    private DsgCouponSend coupon;

    @ApiModelProperty(value = "申請單號")
    @TableField("APP_NO")
    private String appNo;

//    @ApiModelProperty(value = "資料類型")
//    @TableField("OWNS_TYPE")
//    private Integer ownsType;

    @ApiModelProperty(value = "車輛資料ID")
    @TableField("CAR_ID")
    private String carId;

    @ApiModelProperty(value = "油公司")
    @TableField("OIL_COM")
    private String oilCom;

    @ApiModelProperty(value = "油咭限額ID")
    @TableField("LIMIT_ID")
    private String limitId;

    @ApiModelProperty(value = "油咭分類")
    @TableField("CARD_CLASSIFY")
    private Integer cardClassify;

    @ApiModelProperty(value = "油咭類型")
    @TableField("CARD_TYPE")
    private String cardType;

    @ApiModelProperty(value = "卡號")
    @TableField("CARD_NO")
    private String cardNo;

    @ApiModelProperty(value = "预录入卡號")
    @TableField("PRE_CARD_NO")
    private String preCardNo;

    @ApiModelProperty(value = "油咭类型（现金咭）")
    @TableField("CARD_TYPE_1")
    private String cardType1;

    @ApiModelProperty(value = "卡名")
    @TableField("CARD_FACE_NAME")
    private String cardFaceName;

    @ApiModelProperty(value = "卡狀態")
    @TableField("CARD_STATUS")
    private Integer cardStatus;

    @ApiModelProperty(value = "油咭限額狀態")
    @TableField("LIMIT_STATUS")
    private Integer limitStatus;

    @ApiModelProperty(value = "卡密碼")
    @TableField("CARD_PASSWORD")
    private String cardPassword;

    @ApiModelProperty(value = "卡入庫時間")
    @TableField("CARD_IN_TIME")
    private Date cardInTime;

    @ApiModelProperty(value = "卡出庫時間")
    @TableField("CARD_OUT_TIME")
    private Date cardOutTime;

    @ApiModelProperty(value = "限額")
    @TableField("LIMIT_AMOUNT")
    private BigDecimal limitAmount;

    @ApiModelProperty(value = "油咭消費總金額")
    @TableField("TOTAL_CONSUM")
    private BigDecimal totalConsum;

    @ApiModelProperty(value = "行政費")
    @TableField("ADMIN_COST")
    private BigDecimal adminCost;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATER")
    private String creater;

    @ApiModelProperty(value = "创建时间")
    @TableField("CREATE_TIME")
    private Date createTime;

    @ApiModelProperty(value = "更新人")
    @TableField("UPDATER")
    private String updater;

    @ApiModelProperty(value = "更新时间")
    @TableField("UPDATE_TIME")
    private Date updateTime;

    @ApiModelProperty(value = "繳款帳號主鍵")
    @TableField("PAY_ID")
    private String payId;

    @ApiModelProperty(value = "主繳款帳號主鍵")
    @TableField(value = "MAIN_PAY_ID")
    private String mainPayId;

    /**
     * 企業編號
     */
    @TableField(value = "ENT_CODE")
    @ApiModelProperty(value = "企業編號", name = "entCode")
    private String entCode;

    @TableField(value = "REMARK")
    @ApiModelProperty(value = "備註", name = "remark")
    private String remark;

    @ApiModelProperty(value = "是否用回旧卡")
    @TableField(exist = false)
    private Integer isUseOld;

    @ApiModelProperty(value = "客戶編號")
    @TableField("CUS_NO")
    private String cusNo;

    @ApiModelProperty(value = "折扣类型（现金咭）")
    @TableField("DIS_TYPE")
    private String disType;

    /**
     * 支付銀行卡號/帳戶編號
     */
    @ApiModelProperty(value = "支付銀行卡號/帳戶編號")
    @TableField(exist = false)
    private String payAccountNo;

    /**
     * 支付銀行名稱/帳戶名稱
     */
    @ApiModelProperty(value = "支付銀行名稱/帳戶名稱")
    @TableField(exist = false)
    private String payAccountName;

    /**
     * 收款帳戶編號
     */
    @ApiModelProperty(value = "收款帳戶編號")
    @TableField(exist = false)
    private String accountNo;

    /**
     * 收款帳戶名稱
     */
    @ApiModelProperty(value = "收款帳戶名稱")
    @TableField(exist = false)
    private String accountName;

    @ApiModelProperty(value = "交易賬目OID")
    @TableField(exist = false)
    private String accountCardOid;

    @ApiModelProperty(value = "到期日（指咭有效期）")
    @TableField("CARD_END_DATE")
    private Date cardEndDate;

    @ApiModelProperty(value = "申請類型")
    @TableField(exist = false)
    private String appType;

    @ApiModelProperty(value = "車輛編號")
    @TableField(exist = false)
    private String carNo;

    @ApiModelProperty(value = "是否導出")
    @TableField(exist = false)
    private String isExport;

    @ApiModelProperty(value = "提交日期開始")
    @TableField(exist = false)
    private String createTimeStart;

    @ApiModelProperty(value = "提交日期結束")
    @TableField(exist = false)
    private String createTimeEnd;

    /************************枚舉**********************/
    public enum AppStatus {
        inForce(4);
        Integer code;

        AppStatus(int code) {
            this.code = code;
        }

        public Integer getCode() {
            return code;
        }
    }

    /**申請狀態（錄入）*/
    public static final int CARD_STATUS_APPLY = 0;
    /**審批通過*/
    public static final int CARD_STATUS_1 = 1;
    /**入庫狀態（已返咭）*/
    public static final int CARD_STATUS_2 = 2;
    /**出庫狀態（已寄咭）*/
    public static final int CARD_STATUS_3 = 3;
    /**生效中/已使用狀態*/
    public static final int CARD_STATUS_4 = 4;
    /**失/壞咭狀態*/
    public static final int CARD_STATUS_5 = 5;
    /**取消咭狀態*/
    public static final int CARD_STATUS_CANCEL = 6;
    /**停咭狀態*/
    public static final int CARD_STATUS_7 = 7;
    /**已過期*/
    public static final int CARD_STATUS_8 = 8;
    /**已轉移油咭*/
    public static final int CARD_STATUS_9 = 9;

    public static final int CARD_CLASSIFY_KEEP = 1;
    public static final int CARD_CLASSIFY_CASH = 2;

    /**未生效*/
    public static final int LIMIT_STATUS_0 = 0;
    /**生效*/
    public static final int LIMIT_STATUS_1 = 1;
}
